﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace M
{
    public class Javascript
    {
        public static void FocusControlOnPageLoad(string ClientID, System.Web.UI.Page page)
        {
            page.RegisterClientScriptBlock("CtrlFocus",
@"<script>
    $(document).ready(function () {
        var el = $('#{ID}').get(0);
        el.scrollIntoView();
        el.focus();
    });
</script>".Replace("{ID}", ClientID));
        }
    }
}